package com.example.demo.entryWarehouse.controller;


import com.example.demo.common.ResponseData;
import com.example.demo.entryWarehouse.service.EntryFormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wangxuan
 * @since 2021-05-03
 */
@RestController
@RequestMapping("/entryWarehouse/entry-form")
@PreAuthorize("hasAnyAuthority('5')")
@CrossOrigin(origins = {"*"})
public class EntryFormController {

    @Autowired
    private EntryFormService entryFormService;

    //所有的入库记录
    @GetMapping("/selectAll")
    public ResponseData selectAll(){
        return entryFormService.selectAll();
    }


    //按时间段查询导出
    @GetMapping("/selectBetweenDate")
    public ResponseData selectBetweenDate(@RequestParam("begindate") String begindate ,@RequestParam("enddate") String enddate){
        return entryFormService.selectBetweenDate(begindate, enddate);
    }

}

